﻿#Include ..\baseHandle.ahk

class Echo extends BaseHandle {
  static nullable := true

  static Handle(parsed) {
    for v in parsed.params
      t .= '-' v ' '
    for k, v in parsed.kvparams.OwnProps()
      IsArray(v) ? t .= Format('-{}=[{}] ', k, v.Join()) : t .= Format('-{}={} ', k, v)
    t .= Array(parsed.target, parsed.extra*).Join(A_Space)

    return this.Succ(t)
  }

   static Spec() {
    return {
      cmd: 'echo',
      desc: '回显处理后的输入',
      format: 'echo [target]',
      args: {
        desc: '任意输入',
        isOptional: true,
        cacheable: false,
      },
      extra: {
        isEnable: false
      }
    }
  }
}
